<template>
	<view class="main">
		<image class="bimg" :src="cover"></image>
		<view class="btn-view">
			<image class="submit" mode="widthFix" :src="btnImg" @click="toQuestion()"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				assessId: '',
				cover: '',
				btnImg: '',
				assessId: 0,
				creatorId: 0,
				accountId: 0,
				taskId: 0,
				movId: 0,
				collectionId: 0,
				urlId: 0,
				callbackId:0,
			}
		},
		onLoad(options) {
			uni.showLoading({
				title: '加载中...'
			})
			this.assessId = options.assessId
			this.creatorId = options.creatorId ?? 0;
			this.accountId = options.accountId ?? 0;
			this.taskId = options.taskId ?? 0;
			this.movId = options.movId ?? 0;
			this.callbackId = options.callbackId ?? 0;
			this.collectionId = options.collectionId ?? 0;
			this.urlId = options.urlId ?? 0;
			this.getInfo()
		},
		onReady() {
			uni.hideLoading()
		},
		methods: {
			getInfo() {
				this.$u.api.assess.getInfo({
					assessId: this.assessId
				}).then(res => {
					if (res.code != 200) {
						this.$u.toast(res.msg);
						return;
					}

					this.cover = res.data.info.images;
					this.btnImg = res.data.info.btn_img;
				})
			},
			// 点击测试
			toQuestion(assessId) {
				uni.navigateTo({
					url: "/pages/sys/assess_bags/question?assessId=" + this.assessId +
						"&creatorId=" + this.creatorId +
						"&accountId=" + this.accountId +
						"&taskId=" + this.taskId +
						"&movId=" + this.movId +
						"&callbackId=" + this.callbackId + 
						"&collectionId=" + this.collectionId + 
						"&urlId=" + this.urlId
						
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	page {
		height: 100%;
		width: 100%
	}

	.main {
		height: 100%;
		width: 100%;
		background-color: #fff;
		position: fixed
	}

	.bimg {
		left: 0;
		position: absolute;
		top: 0;
		width: 100%;
		height: 100%;
	}

	.btn-view {
		bottom: 200rpx;
		position: fixed;
		width: 100%;
		text-align: center;
		z-index: 1
	}

	.submit {
		animation: scaleIng 1s infinite;
		height: 108rpx;
		width: 490rpx
	}

	@keyframes scaleIng {

		100%,
		from {
			transform: scale(1)
		}

		50% {
			transform: scale(1.1)
		}
	}
</style>